package modular {
	import ch.sfug.log.Logger;
	import ch.sfug.log.output.LogPanel;
	
	import modular.module.PreloaderModule;	
	/**
	 * @author Administrator
	 */
	public class DebugBootLoader extends ModuleSetLoader {
		
		public function DebugBootLoader() {
			
			super();
			
			Library.register( stage.loaderInfo.applicationDomain, "root" );
			Modular.setRootLoader( this );
			
			libLoader.preloader = new PreloaderModule();
			
			var panel:LogPanel = new LogPanel( stage );
			Logger.appendOutput( panel, Modular.LOG_ERROR );
			Logger.appendOutput( panel, Modular.LOG_INFO );
		}
		
		public function debugModuleXML( xmlNode:XML ):void {
			var setxml:XML = <ModuleSet />;
			setxml.appendChild( xmlNode );
			loadModuleSet( new ModuleSet( setxml ) );
		}

		
		public function debugModuleClass( className:String ):void {
			var mod_xml:XML = <Module />;
			mod_xml.@["class"] = className;
			debugModuleXML( mod_xml );
		}
	}
}
